﻿<UserControl x:Class="FunctionPoint.Adornment.FunctionPointViewPortAdornmentControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="clr-namespace:System.Windows.Shapes;assembly=PresentationFramework"
             mc:Ignorable="d"  d:DesignHeight="100" d:DesignWidth="150" Name="ucFunctionPointViewPortAdornmentControl"
     Background="Transparent" AllowDrop="True" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FunctionPoint;component/Resources/SharedResourcesDictionary.en-us.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </UserControl.Resources>
    <Grid>

        <Grid.Resources>
            <SolidColorBrush x:Key="rectSolidBackBrush" Color="{Binding BackgroundColor}">

            </SolidColorBrush>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" x:Key="rectBackBrush">
                <GradientStop Color="Orange" Offset="0" />
                <GradientStop Color="Yellow" Offset="1" />
            </LinearGradientBrush>
            <LinearGradientBrush EndPoint="1.3,0" StartPoint="-1,0.0" x:Key="polyFillBrush">
                <GradientStop Color="Yellow" Offset="0" />
                <GradientStop Color="Orange" Offset="1" />
            </LinearGradientBrush>
            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" x:Key="polyStrokeBrush">
                <GradientStop Color="Yellow" Offset="0" />
                <GradientStop Color="Orange" Offset="1" />
            </LinearGradientBrush>



            <!-- Hover -->



            <!-- Non Hover -->

            <Style x:Key="styleAdornmentBackgroundBase">

                <Setter Property="Shape.Fill" Value="{DynamicResource rectSolidBackBrush}"></Setter>
                <Setter Property="Control.Opacity" Value="0.7"></Setter>
                <Setter Property="Control.FontFamily" Value="Segoe UI"></Setter>
                <Setter Property="Control.FontSize" Value="12"></Setter>


               

            </Style>
            <Style TargetType="{x:Type Polygon}" x:Key="styleAdornmnetBackground" BasedOn="{StaticResource styleAdornmentBackgroundBase}">

                <Setter Property="VerticalAlignment" Value="Top"></Setter>
                <Setter Property="HorizontalAlignment" Value="Center"></Setter>
                <Setter Property="Margin" Value="0"></Setter>
                <Setter Property="StrokeThickness" Value="2"></Setter>
                <Setter Property="Stroke" Value="{StaticResource polyStrokeBrush}"></Setter>
                <Setter Property="Fill" Value="{StaticResource polyFillBrush}"></Setter>


            </Style>
            <Style TargetType="{x:Type Rectangle}" x:Key="styleAdornmentBackground" BasedOn="{StaticResource styleAdornmentBackgroundBase}">

                <!--<Setter Property="Width" Value="100"></Setter>-->
                <Setter Property="Height" Value="60"></Setter>
                <Setter Property="RadiusX" Value="8"></Setter>
                <Setter Property="RadiusY" Value="8"></Setter>

                <Style.Triggers>
                    <Trigger Property="Control.IsMouseOver" Value="True">
                        <Setter Property="TextBlock.FontWeight" Value="Bold"></Setter>
                        <Setter Property="Control.Width" Value="400"></Setter>
                        <Setter Property="Control.Opacity" Value="1"></Setter>
                    </Trigger>

                </Style.Triggers>

            </Style>

        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" MaxWidth="11" ></ColumnDefinition>
            <ColumnDefinition Width="*" MinWidth="100"></ColumnDefinition>
        </Grid.ColumnDefinitions>

        <Polygon Style="{StaticResource styleAdornmnetBackground}" Grid.Row="0" Grid.Column="0">

            <Polygon.Points>
                <Point X="10" Y="50" />
                <Point X="20" Y="47" />
                <Point X="20" Y="53" />
            </Polygon.Points>

        </Polygon>
        <Rectangle Name="rectAdornmentBackground"  Grid.Column="1" Style="{StaticResource styleAdornmentBackground}" HorizontalAlignment="Stretch" >
        </Rectangle>
        <StackPanel Grid.Column="1" Orientation="Vertical" DragDrop.PreviewDragEnter="StackPanel_PreviewDragEnter" DragDrop.PreviewDragOver="StackPanel_PreviewDragOver"
                     DragDrop.PreviewDrop="StackPanel_PreviewDrop" DragDrop.PreviewGiveFeedback="StackPanel_PreviewGiveFeedback" DragDrop.PreviewQueryContinueDrag="StackPanel_PreviewQueryContinueDrag"
                    DragDrop.Drop="StackPanel_Drop" >
            <StackPanel.Resources>
                <Style x:Key="subTitleBoldTextBlock" TargetType="{x:Type TextBlock}">
                    <Setter Property="FontSize" Value="10" />
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="Margin" Value="4,2,2,2" />
                    
                </Style>
                <Style x:Key="subTitleItalicTextBlock" TargetType="{x:Type TextBlock}">
                    <Setter Property="FontSize" Value="10" />
                    <Setter Property="FontStyle" Value="Italic" />
                    <Setter Property="Margin" Value="4,2,2,2" />
                </Style>
            </StackPanel.Resources>
            <TextBlock Text="{Binding Title}" />
            <TextBlock Text="{Binding FunctionPointTitle}" Style="{StaticResource subTitleBoldTextBlock}"  />
            <TextBlock Text="{Binding SolutionDesigner}" Style="{StaticResource subTitleItalicTextBlock}"  />

        </StackPanel>

        <!--Height="{Binding ElementName=rectAdornmentBackground, Path=Height}"-->
    </Grid>


</UserControl>
